package text;

import pers.mydb.ORM.ObjectRelationMapping;
import pers.mydb.connection.DBConnection;
import pers.mydb.connection.configuration.Configuration;
import pers.mydb.throwable.MyDBException;
import pers.myutil.throwable.local.MyUtilLocalException;

import java.beans.IntrospectionException;
import java.lang.reflect.InvocationTargetException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Map;

public class UserThread extends Thread {

    public UserThread(String a) {
        this.a = a;
    }

//    public void c(String sql) throws SQLException, MyDBException, NoSuchMethodException, IntrospectionException, IllegalAccessException, InstantiationException, MyUtilLocalException, InvocationTargetException {
//        Configuration configuration = new Configuration.Builder()
//                .addDbUser("root")
//                .addDbPassword("123456")
//                .addDbDriverClass("com.mysql.cj.jdbc.Driver")
//                .addDbUrl("jdbc:mysql://118.24.123.122:3306/distribution?autoReconnect=true&useSSL=false&serverTimezone=UTC&characterEncoding=utf8")
//                .build();
//
//        Connection connection = DBConnection.getConfiguration(configuration);
////        String sql = "SELECT * FROM user";
//        PreparedStatement pst = connection.prepareStatement(sql);
//        ResultSet resultSet = pst.executeQuery();
//        Map<String,Object> maps = ObjectRelationMapping.handleResultSetToMap(resultSet);
//        System.out.println(((User)ObjectRelationMapping.transfterMapToBeanUnique(User.class,maps)));
////        for(User user : (List<User>)ObjectRelationMapping.transfterMapToBeanList(User.class,maps)){
////            System.out.println(user.toString());
////        }
//    }

    private String a;

    public void run(){
        for (int i = 0;i<50;i++){
            System.out.println(a+i);
        }
    }

}
